#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>

int main(int argc, char const *argv[])
{
    int a = 5;

    pid_t pid = fork();
    if (pid > 0)
    {
        a = 6;
        printf("我是父进程, a的地址是: %p, a的值是%d\n", &a, a);
    }
    else
    {
        printf("我是子进程, a的地址是: %p, a的值是%d\n", &a, a);
    }

    return 0;
}
